package com.polly.esphwevent.services;

import com.polly.esphwevent.domain.HomeworkExt;
import com.polly.esphwevent.repository.HomeworkExtDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

/**
 * @author liqin@nd.com.cn
 * @version V1.0
 * @title: HomeworkExtService
 * @description: TODO(用一句话描述该文件做什么)
 * @date: 2019/3/4 16:47
 */
@Service
public class HomeworkExtService {

    @Autowired
    private HomeworkExtDao homeworkExtDao;


    public HomeworkExt findHomeworkExt(String homeworkExtId){
        return homeworkExtDao.findHomeworkExtByHomeworkId(homeworkExtId);
    }

    @Transactional
    public void batchInsert(){
        homeworkExtDao.save(UUID.randomUUID().toString(), UUID.randomUUID().toString());
        int a = 1 / 0;
        homeworkExtDao.save(UUID.randomUUID().toString(), UUID.randomUUID().toString());
    }

}
